package zoo.member.admin.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class AdminLogonCheckInterceptor extends HandlerInterceptorAdapter{
	    
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response,Object handler)throws Exception{
		
		//session 호출
		HttpSession session = request.getSession();
	
		String ma_name = (String)session.getAttribute("ma_name");
		
		if(ma_name == null){
			response.sendRedirect("../admin/loginform.do");
			return false;
		}
		
		return true;
	}
}
